import Vue from 'vue'
import Router from 'vue-router'
import Home from "@/components/Home"
import Login from "@/components/Login"
import Register from "@/components/Register"
import Course from "@/components/Course"
import Detail from "@/components/Detail"
import Aliplayer from "@/components/Aliplayer"
import Cart from "@/components/Cart"
import Order from "@/components/Order"
import Success from "@/components/Success"
import UserOrder from "@/components/UserOrder"
import Player from "@/components/Player"
Vue.use(Router);

export default new Router({
  mode: "history",
  routes: [
    {
      path: '/',
      name: "Home",
      component: Home,
    },{
      path: '/user/login',
      name: "Login",
      component: Login,
    },{
      path: '/user/register',
      name: "Register",
      component: Register,
    },{
      path: '/courses',
      name: "Course",
      component: Course,
    },{
      path: '/course/:course',  // 路由的命名参数，:变量名
      name: "Detail",
      component: Detail
    },{
      path: '/aliplayer',
      name: "Aliplayer",
      component: Aliplayer
    },{
      path: '/cart',
      name: "Cart",
      component: Cart
    },{
      path: '/buy',
      name: "Order",
      component: Order
    },{
      path: '/payments/result',
      name: "Success",
      component: Success
    },{
      path: '/my/order',
      name: "UserOrder",
      component: UserOrder,
    },{
      path: '/player/:course/:lesson',
      name: "Player",
      component: Player,
    },
  ]
})
